//
//  MyViewController.m
//  07-HomeWork
//
//  Created by dllo on 16/7/22.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "MyViewController.h"

@interface MyViewController ()

@end

@implementation MyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIImageView *image = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    image.image = [UIImage imageNamed:@"my"];
    [self.view addSubview:image];
    
    UIButton *loginImageButton = [UIButton buttonWithType:UIButtonTypeSystem];
    UIButton *loginTitleButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [loginImageButton setImage:[[UIImage imageNamed:@"login1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    [loginTitleButton setTitle:@"登录/注册" forState:UIControlStateNormal];
    loginTitleButton.titleLabel.font = [UIFont systemFontOfSize:20];
    loginTitleButton.tintColor = [UIColor cyanColor];
    loginImageButton.frame = CGRectMake(157, 50, 100, 100);
    loginTitleButton.frame = CGRectMake(157, 150, 100, 50);
    [self.view addSubview:loginImageButton];
    [self.view addSubview:loginTitleButton];
    [loginTitleButton addTarget:self action:@selector(handleButton:) forControlEvents:UIControlEventTouchUpInside];
    [loginImageButton addTarget:self action:@selector(handleButton:) forControlEvents:UIControlEventTouchUpInside];
}

- (void)handleButton:(UIButton *)button {
    [self dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
